apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Release.Name }}-ueransim-config  
  labels:
    app: ueransim
data:
  open5gs-ue.yaml: |
    # IMSI number of the UE. IMSI = [MCC|MNC|MSISDN] (In total 15 or 16 digits)
    supi: 'imsi-{{ .Values.ueransim.ue.imsi }}'
    # Mobile Country Code value of HPLMN
    mcc: '{{ .Values.config.mcc }}'
    # Mobile Network Code value of HPLMN (2 or 3 digits)
    mnc: '{{ .Values.config.mnc }}'
    
    # Permanent subscription key
    key: '{{ .Values.ueransim.ue.secKey }}'
    # Operator code (OP or OPC) of the UE
    op: '{{ .Values.ueransim.ue.op }}'
    # This value specifies the OP type and it can be either 'OP' or 'OPC'
    opType: 'OPC'
    # Authentication Management Field (AMF) value
    amf: '8000'
    # IMEI number of the device. It is used if no SUPI is provided
    imei: '{{ .Values.ueransim.ue.imei }}'
    # IMEISV number of the device. It is used if no SUPI and IMEI is provided
    imeiSv: '{{ .Values.ueransim.ue.imeiSv }}'
    
    # List of gNB IP addresses for Radio Link Simulation
    gnbSearchList:
      - gNBpodIP
    # UAC Access Identities Configuration
    uacAic:
      mps: false
      mcs: false

    # UAC Access Control Class
    uacAcc:
      normalClass: 0
      class11: false
      class12: false
      class13: false
      class14: false
      class15: false      
    # Initial PDU sessions to be established
    sessions:
      - type: 'IPv4'
        apn: {{ .Values.dnn }}
        slice:
          sst: {{ .Values.config.sst }}
          sd: {{ .Values.config.sd }}
        emergency: false
    
    # Configured NSSAI for this UE by HPLMN
    configured-nssai:
      - sst: {{ .Values.config.sst }}
        sd: {{ .Values.config.sd }}
    
    # Default Configured NSSAI for this UE
    default-nssai:
      - sst: {{ .Values.config.sst }}
        sd: {{ .Values.config.sd }}
    
    # Supported encryption algorithms by this UE
    integrity:
      IA1: true
      IA2: true
      IA3: true
    
    # Supported integrity algorithms by this UE
    ciphering:
      EA1: true
      EA2: true
      EA3: true
    
    # Integrity protection maximum data rate for user plane
    integrityMaxRate:
      uplink: 'full'
      downlink: 'full'  
  open5gs-gnb.yaml: |
    mcc: '{{ .Values.config.mcc }}'          # Mobile Country Code value
    mnc: '{{ .Values.config.mnc }}'           # Mobile Network Code value (2 or 3 digits)
    
    nci: '0x000000010'  # NR Cell Identity (36-bit)
    idLength: 32        # NR gNB ID length in bits [22...32]
    tac: {{ .Values.config.tac }}             # Tracking Area Code
    
    linkIp: gnbLocalIP   # gNB's local IP address for Radio Link Simulation (Usually same with local IP)
    ngapIp: gnbLocalIP   # gNB's local IP address for N2 Interface (Usually same with local IP)
    gtpIp: gnbLocalIP   # gNB's local IP address for N3 Interface (Usually same with local IP)
    
    # List of AMF address information
    amfConfigs:
      - address: {{ .Release.Name }}-amf
        port: {{ .Values.ueransim.gnb.amfPort }}
    
    # List of supported S-NSSAIs by this gNB
    slices:
      - sst: {{ .Values.config.sst }}
        sd: {{ .Values.config.sd }}
    
    # Indicates whether or not SCTP stream number errors should be ignored.
    ignoreStreamIds: true
